package com.hr.controller;

import com.hr.entity.AoaDept;
import com.hr.service.AoaDeptService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (AoaDept)表控制层
 *
 * @author makejava
 * @since 2022-06-19 09:07:38
 */
@RestController
@RequestMapping("aoaDept")
public class AoaDeptController{
    /**
     * 服务对象
     */
    @Resource
    private AoaDeptService aoaDeptService;

    /**
     * 查询部门列表
     */
    @RequestMapping("/queryList")
    public List<AoaDept> queryList(){
       return aoaDeptService.queryList();
    }

    /**
     * 添加或修改
     * @param aoaDept
     * @return
     */
    @PostMapping("/save")
    public boolean save(
            @RequestBody AoaDept aoaDept) {
        return aoaDeptService.save(aoaDept);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/delete")
    public boolean delete(Integer id){
        boolean bool = aoaDeptService.delete(id);
        return bool;
    }

    /**
     * 单值查询
     * @param id
     * @return
     */
    @GetMapping("/queryById")
    public AoaDept queryById(Integer id){
        AoaDept aoaDept = aoaDeptService.queryById(id);
        return aoaDept;
    }
}

